﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace dbPoll_Application.Models
{
    public class QuestionChart
    {
        public virtual int chartID { get; set; }
        public virtual String chartType { get; set; }
        public virtual String valueType { get; set; }
        public virtual String colours { get; set; }
        public virtual Boolean active { get; set; }

        public QuestionChart()
        {
            this.chartID = -1;
            this.chartType = String.Empty;
            this.valueType = String.Empty;
            this.colours = String.Empty;
            this.active = false;
        }

        public QuestionChart(String chartType, String valueType, String colours)
        {
            this.chartID = -1;
            this.chartType = chartType;
            this.valueType = valueType;
            this.colours = colours;
            this.active = false;
        }

        public QuestionChart(String chartType, String valueType, String colours, Boolean active)
        {
            this.chartID = -1;
            this.chartType = chartType;
            this.valueType = valueType;
            this.colours = colours;
            this.active = active;
        }

        public QuestionChart(QuestionChart chart)
        {
            this.chartID = -1;
            this.chartType = chart.chartType;
            this.valueType = chart.valueType;
            this.colours = chart.colours;
            this.active = chart.active;
        }

        public QuestionChart(int chartID, String chartType, String valueType, String colours)
        {
            this.chartID = chartID;
            this.chartType = chartType;
            this.valueType = valueType;
            this.colours = colours;
            this.active = false;
        }

        public virtual String GetQuestionChartType()
        {
            String type;
            if (chartType == "Vertical Bar")
            {
                type = "ColumnChart";
            }
            else if (chartType == "Horizontal Bar")
            {
                type = "BarChart";
            }
            else
            {
                type = "PieChart";
            }

            return type;
        }

    }
}
